#include "USocketUtil.h"

#include "proto\ChatMsg.pb.h"
#include "socket\SocketThread.h"
#include "socket\BaseRequestMsg.h"



USocketUtil::USocketUtil(void)
{
}


USocketUtil::~USocketUtil(void)
{
}

void USocketUtil::StartSocketThread()
{
	SocketThread* th=  SocketThread::GetInstance();
	th->start();
}


void USocketUtil::SendMsg( short code,int player,const char* m_char_msg )
{
	//BaseRequestMsg<hz::gyl::ChatMsg>* baserlong=new BaseRequestMsg<hz::gyl::ChatMsg>();
	hz::gyl::ChatMsg req;
	req.set_msgtype(1);
	req.set_message(m_char_msg);
	BaseRequestMsg<hz::gyl::ChatMsg>* baserlong=new BaseRequestMsg<hz::gyl::ChatMsg>();
	baserlong->setMessageHead((short)1000,(int)1);
	baserlong->setRequestMessage(req);
	baserlong->sendMessage();

	//req.set_msgtype(1);
	//req.set_message("ddddd");
	//baserlong->setMessageHead((short)1000,(int)
	//	1);
	//baserlong->setRequestMessage(req);
	//baserlong->sendMessage();
}

